{% extends "home/base.html" %}
{% block title %}Cases{% endblock %}
{% block heading %}Cases{% endblock %}

{% block body %}

<div class="container">

  <ul class="collapsible popout" data-collapsible="accordion">
    <li>
      <div class="collapsible-header"><i class="material-icons">check_box_outline_blank</i>Open Cases</div>
      <div class="collapsible-body">
        <ul class="collapsible popout" data-collapsible="accordion">
          {% for case in openCases %}
          <li>
            <div class="collapsible-header blue-grey"><i
                class="material-icons">assignment_turned_in</i>{{case.patient.first_name}}'s case generated on
              {{case.filed_date}}</div>
            <div class="collapsible-body">
              <span>Patient</span> <span class="blue-text text-lighten-1">{{case.patient.first_name}}
                {{case.patient.last_name}}</span><br>
              <span>Case Generated By</span> <span class="blue-text text-lighten-1">{{case.receptionist.first_name}}
                {{case.receptionist.last_name}}</span><br>
              <span>Description</span> <span class="blue-text text-lighten-1">{{case.description}}</span><br>
              <span>Filed Date</span> <span class="blue-text text-lighten-1">{{case.filed_date}}</span><br>
              {% if isDoctor %}
              <span><a href="/bill/generate/{{case.id}}" class="btn grey"><span class="white-text text-lighten-1">Add
                    Medicines</span></a></span><br>
              <span><a href="/bill/generate/{{case.id}}" class="btn grey"><span
                    class="white-text text-lighten-1">Chemical Exam</span></a></span><br>
                  <span><a href="/reports/view_reports/{{case.id}}" class="btn grey"><span
                    class="white-text text-lighten-1">View reports</span></a></span><br>
              <span class="right-align"><a href="/case/close/{{case.id}}"
                  class="btn-floating btn-large halfway-fab waves-effect waves-light blue-grey right-align"><i
                    class="material-icons">close</i></a></span>
              {% endif %}
            </div>
          </li>
          {% endfor %}
        </ul>
      </div>
    </li>
    <li>
      <div class="collapsible-header"><i class="material-icons">check_box</i>Closed Cases</div>
      <div class="collapsible-body">
        <ul class="collapsible popout" data-collapsible="accordion">
          {% for case in closedCases %}
          <li>
            <div class="collapsible-header blue-grey"><i
                class="material-icons">assignment_turned_in</i>{{case.patient.first_name}}'s case generated on
              {{case.filed_date}}</div>
            <div class="collapsible-body">
              <span>Patient</span> <span class="blue-text text-lighten-1">{{case.patient.first_name}}
                {{case.patient.last_name}}</span><br>
              <span>Case Generated By</span> <span class="blue-text text-lighten-1">{{case.receptionist.first_name}}
                {{case.receptionist.last_name}}</span><br>
              <span>Description</span> <span class="blue-text text-lighten-1">{{case.description}}</span><br>
              <span>Filed Date</span> <span class="blue-text text-lighten-1">{{case.filed_date}}</span><br>
              <span>Closed Date</span> <span class="blue-text text-lighten-1">{{case.closed_date}}</span><br>
            </div>
          </li>
          {% endfor %}
        </ul>
      </div>
    </li>
  </ul>

</div>
{% endblock %}